import java.time.format.DateTimeFormatter;
import java.time.*;

public class Text_DateTimeFormatter {
    public static void main(String[] args) {
        LocalDateTime localDateTime1 = LocalDateTime.of(2023,12,12,13,13,22);
        LocalDateTime localDateTime2 = LocalDateTime.of(2023,12,12,14,13,22);

        Duration duration = Duration.between(localDateTime1,localDateTime2);
        System.out.println(duration.toDays());
        System.out.println(duration.toHours());
        System.out.println(duration.toMinutes());
        System.out.println(duration.getSeconds());
        System.out.println(duration.toMillis());
    }

}
/*    public static void main(String[] args) {
        LocalDateTime l1 = LocalDateTime.of(2029,12,12,2,12,11);
        LocalDateTime l2 = LocalDateTime.of(2029,12,12,2,12,12);

        Duration duration = Duration.between(l1,l2);
        System.out.println(duration.getSeconds());

    }

}*/
/*    public static void main(String[] args) {
        LocalDate localDate1 = LocalDate.of(2026,12,12);
        LocalDate localDate2 = LocalDate.of(2028,12,12);

        Period period = Period.between(localDate1,localDate2);
        //相差的年数
        System.out.println(period.getYears());
        //相差的月数
        System.out.println(period.getMonths());
        //相差的天数
        System.out.println(period.getDays());

    }
}*/
/*    public static void main(String[] args) {
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String str = "2028-12-12 09:30:30";

        LocalDateTime ldt = LocalDateTime.parse(str,dtf);
        System.out.println(ldt);
    }
}*/
/*        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss EEE a");

        LocalDateTime ldt = LocalDateTime.now();
        String b = dtf.format(ldt);
        String a = ldt.format(dtf);

        System.out.println(a);
        System.out.println(b);

    }
}*/
